<?
require("enroll_config.php");

$location_status .= "| Add";
$show_backnav = "enroll_menu";
$menuname = NULL;
$menutarget = NULL;

if (NULL!=$action){

   $field = array(
	"code",
"first_name",
"last_name",
"position",
"company",
"c_address",
"p_address",
"email",
"o_phone",
"m_phone",
"h_phone",
"aid",
"date",
"status",
"city",
"state",
"zip",
"country",
"pstate",
"pzip",
	"pcity",
	"pcountry",
	);


   $content = array(
	$code,
$first_name,
$last_name,
$position,
$company,
$c_address,
$p_address,
$email,
$o_phone,
$m_phone,
$h_phone,
$aid,
$date,
$status,
$City,
$State,
$Zip,
$Country,
$Pstate,
$Pzip,
	$Pcity,
	$PCountry,
	);

   myInsert($table,$field,$content);

if ($newsletter == "checked") {
$table = "med_subscription";
   $field = array(
	"email", 
	"name", 
	"date", 
		"company",
	"address",
	);

$Name = $first_name . $last_name;
   $content = array(
	$email,
	$Name,
	$date,
	$company,
	$c_address,
	);

   myInsert($table,$field,$content);
}

$q = "update med_aevening set enrollments=enrollments+1 where id='$aid'";
$r = myQuery($q);

   header("location:" . $rela_path . "share/msg.php?v=72&aid=$aid");

   exit();

}else{

  if (checkCode($table,$Code)){

	header("location:" . $rela_path . "share/msg.php?v=9002");

	exit();
  
  }

}

require($rela_path . "inc/header2.php");

?>



<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="action" type="hidden" value="add">
<input name="code" type="hidden" value="<?print($Code)?>">
<input name="aid" type="hidden" value="<?print($aid)?>">
<input name="date" type="hidden" value="<?=date("Y-m-d H:i:s")?>">


<table width="95%" border="0" align="center">
  <tr>
    <td valign="top">&nbsp;</td>
  </tr>
  <tr> 
    <td valign="top"> <p> 
      <table border="0" cellspacing="5" cellpadding="1">
        <tr> 
          <td class="tdheader">Code :</td>
          <td><?print($Code)?></td>
        </tr>
        <tr>
          <td class="tdheader">Date:</td>
          <td><?=date("Y-m-d H:i:s")?></td>
        </tr>
        <tr>
          <td class="tdheader">Acuity Evening: </td>
          <td><?



$Query = "select presented from med_aevening where id='$aid'";
$r = myQuery($Query);

echo $r[0][0];

?></td>
        </tr>
        <tr>
          <td class="tdheader">Status :</td>
          <td>
            <select name="status" class="select" id="status">
              <option value="Registered">Registered</option>
              <option value="Waiting">Waiting</option>
              <option value="Cancelled">Cancelled</option>
              <option value="Attended">Attended</option>
              <option value="Non-attend">Non-attend</option>
                        </select>
          </td>
        </tr>
        <tr> 
          <td class="tdheader">First Name :</td>
          <td><input name="first_name" type="text" class="text" id="first_name" size="40"></td>
        </tr>
        <tr>
          <td class="tdheader">Last Name :</td>
          <td>
            <input name="last_name" type="text" class="text" id="last_name" size="40">
          </td>
        </tr>
        <tr>
          <td class="tdheader">Position :</td>
          <td>
            <input name="position" type="text" class="text" id="position" size="40">
          </td>
        </tr>
        <tr>
          <td class="tdheader">Company :</td>
          <td>
            <input name="company" type="text" class="text" id="company" size="40">
          </td>
        </tr>
        <tr>
          <td><font color="red">*</font> Address </td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><font color="red">&nbsp; </font> Street </td>
          <td><input name="c_address" type="text" class="text" id="c_address" size="30" /></td>
        </tr>
        <tr>
          <td> City</td>
          <td><input type="text" name="City" size="30" class="text" /></td>
        </tr>
        <tr>
          <td><font color="red">&nbsp; </font> State / Province </td>
          <td><input name="State" type="text" class="text" id="State" size="30" /></td>
        </tr>
        <tr>
          <td> ZIP / Postal Code </td>
          <td><input name="Zip" type="text" class="text" id="Zip" size="30" /></td>
        </tr>
        <tr>
          <td class="tdheader">Country :</td>
          <td><?print(FFPCountry("HONG KONG"))?></td>
        </tr>
        <tr>
          <td>Private Address </td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><font color="red">&nbsp; </font> Street </td>
          <td><input name="p_address" type="text" class="text" id="p_address" size="30" /></td>
        </tr>
        <tr>
          <td> City</td>
          <td><input name="Pcity" type="text" class="text" id="Pcity" size="30" /></td>
        </tr>
        <tr>
          <td><font color="red">&nbsp; </font> State / Province </td>
          <td><input name="Pstate" type="text" class="text" id="Pstate" size="30" /></td>
        </tr>
        <tr>
          <td> ZIP / Postal Code </td>
          <td><input name="Pzip" type="text" class="text" id="Pzip" size="30" /></td>
        </tr>
        <tr>
          <td class="tdheader">Country :</td>
          <td><?print(FFPCountry("HONG KONG", "PCountry"))?></td>
        </tr>
        <tr>
          <td class="tdheader">Email :</td>
          <td>
            <input name="email" type="text" class="text" id="email" size="40">
          </td>
        </tr>
        <tr>
          <td class="tdheader">Office Phone  :</td>
          <td>
            <input name="o_phone" type="text" class="text" id="o_phone" size="40">
          </td>
        </tr>
        <tr>
          <td class="tdheader">Mobile Phone  :</td>
          <td>
            <input name="m_phone" type="text" class="text" id="m_phone" size="40">
          </td>
        </tr>
        <tr>
          <td class="tdheader">Home Phone  :</td>
          <td>
            <input name="h_phone" type="text" class="text" id="h_phone" size="40">
          </td>
        </tr>
        <tr>
          <td class="tdheader">Subscribe to Newsletter? </td>
          <td>
          
              <input name="newsletter" type="checkbox" id="newsletter" value="checked">
    
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('enroll_menu.php?id=<?=$aid?>',1);return false;"> <input type="image" src="../../images/bt_save.gif">
          </td>
        </tr>
      </table>
      <p> <br>
      <p>
      <p>
      <p>
      <p>
      <p>
      <p> 
      <p>
    </td>
  </tr>
</table>
</form>
<br>
<br>
<br>
<?
require($rela_path . "inc/footer.php");
?>
